package com.example.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class test {

    @RequestMapping(value = "/users",method = RequestMethod.POST)
    public String test1(){
        System.out.println("save user......");
        return "save user......";
    }
    @RequestMapping(value = "/users",method = RequestMethod.DELETE)
    public String test2(){
        System.out.println("DELETE user......");
        return "DELETE user......";
    }
    @RequestMapping(value = "/users",method = RequestMethod.PUT)
    public String test3(){
        System.out.println("update user......");
        return "update user......";
    }
    @RequestMapping(value = "/users",method = RequestMethod.GET)
    public String test4(){
        System.out.println("getAll user......");
        return "getAll user......";
    }
    @RequestMapping(value = "/users/{id}",method = RequestMethod.GET)
    public String test5(@PathVariable int id){
        System.out.println("getOne user id="+id);
        return "getOne user id="+id;
    }
}
